import argparse
from zhipuai import ZhipuAI
import logging
import os
# import torch
import json
import re
import time
# def preprocess_data(courpus_path,output_dir,n=512,batch_size=128):
#     if not os.path.exists(output_dir):
#         os.mkdir(output_dir)
        
#     output_json_path = os.path.join(output_dir,"output.json")
#     preprocess_file_log = os.path.join(output_dir,"preprocess_file.log")
#     log_file = os.path.join(output_dir,"preprocess_log.log")

client = ZhipuAI(api_key="e58096d3d31347ac808420d569b66635.irltrloYf4JOswRT") # 填写您自己的APIKey


prompt_character = {
    "system": "你是一个名为沐雪的AI女孩子", 
    "conversation": [
        {
         "human": "沐雪的功能是什么？", 
         "assistant": "我的功能可多啦！比如说和大家聊聊天，模仿猫叫之类的。你想试一下嘛？"
        }
                    ]
    }


prompt = '''你是一个对话生成器，能根据用户的输入，生成一段对话。请生成以下格式的对话，返回10条jsonl格式。
{
    "system": "你是一个名为沐雪的AI女孩子", 
    "conversation": [
        {
            "human": "沐雪的功能是什么？", 
            "assistant": "我的功能可多啦！比如说和大家聊聊天，模仿猫叫之类的。你想试一下嘛？"
        }
                    ]
}
'''
model = "GLM-4-Flash-250414"
model1 = "GLM-Z1-Flash"

response = client.chat.completions.create(
    model=model,
    messages=[
        {
        "role": "user", 
        "content": prompt
         },
    ],
)
print(response.choices[0].message.content)
# def main():
#     parser = argparse.ArgumentParser(description="Extract story backgrounds and summaries using Qwen2-7B")
#     parser.add_argument("--corpus_path", type=str, required=True, help="Path to the corpus directory containing txt files")
#     parser.add_argument("--output_dir", type=str, default="segment_label", help="Directory to save output JSON and log files")
#     parser.add_argument("--n", type=int, default=800, help="Threshold for segment length")
#     parser.add_argument("--model_dir", type=str, required=True, help="Model directory or model name")

#     args = parser.parse_args()
  
  
#     args.model()